CXX=g++
CXXFLAGS=--std=c++0x -Wall -Wextra -O2 -I./include 

split_queries=split_queries
split_queries_src=./src/split_queries.cpp

process=process
process_src=./src/process.cpp

merge_answers=merge_answers
merge_answers_src=./src/merge_answers.cpp

query1=query1
query1_src=./src/query1/main_new_with_pattern.cpp

query2=query2
query2_src=./src/query2/main_new.cpp

query3=query3
query3_src=./src/query3/main.cpp

query4=query4
query4_src=./src/query4/main_new.cpp

all: $(split_queries) $(process) $(merge_answers) $(query1) $(query2) $(query3) $(query4)

$(split_queries):
	$(CXX) $(CXXFLAGS) -o $(split_queries) $(split_queries_src)

$(process):
	$(CXX) $(CXXFLAGS) -o $(process) $(process_src)

$(merge_answers):
	$(CXX) $(CXXFLAGS) -o $(merge_answers) $(merge_answers_src)

$(query1):
	$(CXX) $(CXXFLAGS) -o $(query1) $(query1_src)

$(query2):
	$(CXX) $(CXXFLAGS) -o $(query2) $(query2_src)

$(query3):
	$(CXX) $(CXXFLAGS) -o $(query3) $(query3_src)

$(query4):
	$(CXX) $(CXXFLAGS) -o $(query4) $(query4_src)

clean:
	rm -rf $(split_queries)* $(process)* $(merge_answers)* $(query1)* $(query2)* $(query3)* $(query4)*
